<template>
  <div class="container">
    <el-dialog title="预览文章" :visible="dialogVisible" width="60%" @close='lookCancel'>
      <h1>{{articles.title}}</h1>
      <div>
        <span style="margin-right:15px">{{articles.createTime | moment('YYYY-MM-DD HH-mm-ss')}}</span>
        <span style="margin-right:15px">{{articles.username}}</span>
        <i class="el-icon-view" style="margin-right:15px"></i>
        <span>{{articles.visits}}</span>
      </div>
      <div style="height:60px;border-top: 1px dashed gray;margin-top:10px;background:#F5F5F5;line-height:60px;padding-left:10px">{{articles.articleBody}}</div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    articles: {
      type: Object
    }
  },
  methods: {
    lookCancel () {
      this.$refs.ruleForm.resetFields()
      this.$emit('update:dialogVisible', false)
    }
  }
}
</script>

<style scoped lang='less'></style>
